﻿/* 
 * TABLE: Responses 
 */

/* 
 * TABLE: Responses 
 */

CREATE TABLE Responses(
    ResponseId       int               IDENTITY(1,1),
    Content          nvarchar(1000)    NOT NULL,
    DateOfPublish    datetime2(0)      NOT NULL,
    UserId           int               NOT NULL,
    BookId           int               NOT NULL,
    CONSTRAINT PK14 PRIMARY KEY NONCLUSTERED (ResponseId)
)
GO
ALTER TABLE Responses ADD CONSTRAINT RefBooks24 
    FOREIGN KEY (BookId)
    REFERENCES Books(BookId)
GO
/* 
 * TABLE: Responses 
 */

/* 
 * TABLE: Responses 
 */

ALTER TABLE Responses ADD CONSTRAINT RefUsers23 
    FOREIGN KEY (UserId)
    REFERENCES Users(UserId)